<!--
 * @Author: Easycome 2684545336@qq.com
 * @Date: 2025-03-19 19:26:40
 * @LastEditors: Easycome 2684545336@qq.com
 * @LastEditTime: 2025-04-18 20:25:38
 * @FilePath: \yupao-frontend-master\src\pages\UserSettingPage.vue
 * @Description: 用户设置页面
-->
<template>
    <van-cell title="用户协议" size="large" is-link to="/user/agreement"/>
    <van-cell title="隐私政策" size="large" is-link to="/user/privacy"/>
    <van-cell title="关于我们" size="large" is-link to="/user/about"/>
    <van-button color="linear-gradient(to right, #ff6034, #ee0a24)" @click="exitLogin" round
                style="width: 90%; margin: 30px auto" block>
        退出登录
    </van-button>
</template>

<script setup lang="ts">
import {userLogout} from "../services/user";
import {showSuccessToast} from "vant";
import {useRouter} from "vue-router";

const router = useRouter();
const exitLogin = async () => {
    // 退出登录实现
    const res = await userLogout();
    if (res?.code === 0) {
        showSuccessToast("退出登录成功")
        await router.push({
            path: '/user/login'
        })
    }
}
</script>

<style scoped>
.van-cell {
    margin-bottom: 8px;
}
</style>
